﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="GISWebRole._Default" Async="true" AsyncTimeout="3600" EnableViewState="false"
    EnableEventValidation="false"%>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    
    <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#btnSubmit").click(function () {
                var params = '{ map1 : "' + document.getElementById('<%=ddlMap1.ClientID %>').value + '",' +
                        'map2 : "' + document.getElementById('<%=ddlMap2.ClientID %>').value + '",' +
                        'op : "' + document.getElementById('<%=ddlOperator.ClientID %>').value + '",' +
                        'scheme : "' + document.getElementById('<%=ddlLoadBalance.ClientID %>').value + '",' +
                        'col : "' + document.getElementById('<%=txtCellColumnCount.ClientID %>').value + '",' +
                        'row : "' + document.getElementById('<%=txtCellRowCount.ClientID %>').value + '"}';
                $('#spinner').show();
                $('#results').text('');
                $.ajax({
                    type: "POST",
                    url: "Default.aspx/Overlay",
                    data: params,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        var dmsg = '';
                        if (msg == null) {
                            dmsg = 'null';
                        } else {
                            dmsg = msg.d;
                        }
                        $("#results").text(dmsg);
                        $('#spinner').hide();
                    },
                    error: function (error) {
                        $("#results").text(error);
                        $('#spinner').hide();
                    }
                });
            });
        });
    </script>
    <div>
        Overlay Operation</div>
    <div id="parameters">
        <asp:DropDownList ID="ddlMap1" runat="server">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlOperator" runat="server">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlMap2" runat="server">
        </asp:DropDownList>
        <asp:DropDownList ID="ddlLoadBalance" runat="server">
        </asp:DropDownList>
        <br />
        <asp:Label ID="lblCellWidth" runat="server" Text="Cell Columns"></asp:Label>
        <asp:TextBox ID="txtCellColumnCount" runat="server"></asp:TextBox>
        <asp:Label ID="lblCellHeight" runat="server" Text="Cell Rows"></asp:Label>
        <asp:TextBox ID="txtCellRowCount" runat="server"></asp:TextBox>
        <br />
        <input type="button" id="btnSubmit" value="Overlay"/>
    </div>
    <div id="spinner" class="spinner">
        <img alt="loading..." title="loading..." src="img/ajax-loader.gif" />
    </div>
    <div id="results"></div>    
</asp:Content>
